fn main() {
    let names = vec!["Bob", "Frank", "Ferris"];
    // borrow the element and kept untouched
    for name in names.iter() {
        match name {
            &"Ferris" => println!("There is a rustacean among us!"),
            // TODO ^ Try deleting the & and matching just "Ferris"
            _ => println!("Hello {}", name),
        }
    }
    
    println!("names: {:?}", names);

    let names = vec!["Bob", "Frank", "Ferris"];
    // just get the value of element, and remove it from vec, like pop
    for name in names.into_iter() {
        match name {
            "Ferris" => println!("There is a rustacean among us!"),
            _ => println!("Hello {}", name),
        }
    }
    
    // println!("names: {:?}", names);

    let mut names = vec!["Bob", "Frank", "Ferris"];
    // borrow element mut
    for name in names.iter_mut() {
        *name = match name {
            &mut "Ferris" => "There is a rustacean among us!",
            _ => "Hello",
        }
    }

    println!("names: {:?}", names);
}
